package com.zbs.framework.dao.user.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.zbs.framework.swagger.annotations.ApiModel;
import com.zbs.framework.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
@NoArgsConstructor
@ApiModel
public class BaseUserInfo {
    @ApiModelProperty("用户ID")
    private Long id;
    @ApiModelProperty("用户昵称")
    private String name; // 真实姓名
    @ApiModelProperty("用户性别 1 男 0 女")
    private Character gender; // 性别
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime; // 创建时间
    @ApiModelProperty("用户类型")
    private Character userType; // 用户类型
    @ApiModelProperty("生日")
    private String birthday; // 生日
    @ApiModelProperty("头像")
    private String headImg;// 头像
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("角色ID")
    private Integer[] roleIds;

    public BaseUserInfo(MNBaseUser baseUser, Integer[] roleIds) {
        this.id = baseUser.getId();
        this.name = baseUser.getName();
        this.gender = baseUser.getGender();
        this.createTime = baseUser.getCreateTime();
        this.userType = baseUser.getUserType();
        this.birthday = baseUser.getBirthday();
        this.headImg = baseUser.getHeadImg();
        this.phone = baseUser.getPhone();
        this.roleIds = roleIds;
    }


}
